package com.peng.mybatis.reflection.wrapper;

import com.peng.mybatis.reflection.MetaObject;
import com.peng.mybatis.reflection.factory.ObjectFactory;
import com.peng.mybatis.reflection.property.PropertyTokenizer;

import java.util.List;

public interface ObjectWrapper {

    Object get(PropertyTokenizer prop);

    void set(PropertyTokenizer prop, Object value);

    String findProperty(String name, boolean useCamelCaseMapping);

    String[] getGetterNames();

    String[] getSetterNames();

    Class<?> getSetterType(String name);

    Class<?> getGetterType(String name);

    /**
     * 是否含有指定的setter
     */
    boolean hasSetter(String name);

    /**
     * 是否含有指定的getter
     */
    boolean hasGetter(String name);

    // 实例化属性
    MetaObject instantiatePropertyValue(String name, PropertyTokenizer prop, ObjectFactory objectFactory);

    boolean isCollection();

    void add(Object element);

    <E> void addAll(List<E> elements);

}
